{extend name="iframe" /}

{block name="body"}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list">
            <form action="{:request()->url()}" method="post" class="xn_ajax" data-type="open">
                <div class="layui-form-item">
                    <label class="layui-form-label">上级分类</label>
                    <div class="layui-input-block">
                        <select name="cid" lay-verify="required">
                            <option value="0">--顶级分类--</option>
                            {foreach name="class_list" item="vo"}
                            <option value="{$vo.id}" {if condition="$cid eq $vo['id']"}selected{/if} >{$vo._name|raw}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">标题</label>
                    <div class="layui-input-block">
                        <input type="text" name="title" lay-verify="required" placeholder="标题" autocomplete="off" class="layui-input" value="{$data.title}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">图片</label>
                    <div class="layui-input-block">
                        {:xn_upload_one($data['image'],'image',0)}
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">详情</label>
                    <div class="layui-input-block">
                        <textarea name="content" id="content" style="width: 95%;">{$data.content}</textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">浏览</label>
                    <div class="layui-input-block">
                        <input type="number" name="view" placeholder="浏览次数" autocomplete="off" class="layui-input" value="{$data.view}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">热门</label>
                    <div class="layui-input-block">
                        <input type="radio" name="is_hot" value="0" title="否" {if condition="$data['is_hot'] eq 0"}checked{/if}>
                        <input type="radio" name="is_hot" value="1" title="是" {if condition="$data['is_hot'] eq 1"}checked{/if}>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="submit" lay-submit class="layui-btn">保存</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}

{block name="js"}
<!--编辑器-->
<script src="/static/admin/ueditor/ueditor.config.js"></script>
<script src="/static/admin/ueditor/ueditor.all.min.js"></script>
<script src="/static/admin/ueditor/lang/zh-cn/zh-cn.js"></script>
<script>
    UE.getEditor('content',{
        //简洁编辑框
        //toolbars:[['FullScreen', 'Undo','Redo','underline','strikethrough','paragraph','fontsize','Bold','blockquote', '|', 'forecolor', 'backcolor', 'insertorderedlist','simpleupload', 'insertimage','inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown','splittocells', 'splittorows', 'splittocols', 'link', 'unlink','insertcode']],
        initialFrameHeight:300,// 设置编辑器高度
        scaleEnabled:true,
        serverUrl:"{:url('UeditorUpload/index')}"
    });
</script>
{/block}